
{% if page %}
<nav aria-label="Page navigation" class="text-center">
    <ul class="pagination">
        {% if (page.pageNo - 1) <= 0 %}
        <li class="disabled">
            <span>
                <span aria-hidden="true">首页</span>
            </span>
        </li>
        <li class="disabled">
            <span>
                <span aria-hidden="true">&laquo;</span>
            </span>
        </li>
        {% else %}
        <li>
            <a href="/admin/user/list?pageNo=1&pageSize={{page.pageSize}}" aria-label="First">
                <span aria-hidden="true">首页</span>
            </a>
        </li>
        <li>
            <a href="/admin/user/list?pageNo={{page.pageNo - 1}}&pageSize={{page.pageSize}}" aria-label="Previous">
                <span aria-hidden="true">&laquo;</span>
            </a>
        </li>
        {% endif %}

        {% for n in page.pageTotalArray %}
            <li {% if n== page.pageNo %} class="active" {% endif %}>
                <a href="/admin/user/list?pageNo={{n}}&pageSize={{page.pageSize}}">{{n}}</a>
            </li>
        {% endfor %}

        <li>
            <span>
                ...
                <span aria-hidden="true">共{{page.pageTotal}}页</span>
            </span>
        </li>

        {% if (page.pageNo + 1) > page.pageTotal %}
        <li class="disabled">
            <span>
                <span aria-hidden="true">&raquo;</span>
            </span>
        </li>
        <li class="disabled">
            <span>
                <span aria-hidden="true">尾页</span>
            </span>
        </li>
        {% else %}
        <li>
            <a href="/admin/user/list?pageNo={{page.pageNo + 1}}&pageSize={{page.pageSize}}" aria-label="Next"
               aria-label="Previous">
                <span aria-hidden="true">&raquo;</span>
            </a>
        </li>
        <li>
            <a href="/admin/user/list?pageNo={{page.pageTotal}}&pageSize={{page.pageSize}}" aria-label="Last">
                <span aria-hidden="true">尾页</span>
            </a>
        </li>
        {% endif %}

        <li>
            <select name="pageSize" class="form-control" style="display: inline-block;width: auto;margin-left: 10px;">
                <option {% if page.pageSize == 5 %} selected {% endif %}>5</option>
                <option {% if page.pageSize == 10 %} selected {% endif %}>10</option>
                <option {% if page.pageSize == 15 %} selected {% endif %}>15</option>
                <option {% if page.pageSize == 20 %} selected {% endif %}>20</option>
            </select>
        </li>
    </ul>
</nav>
{% else %}
<nav aria-label="Page navigation" class="text-center">
    <ul class="pagination">
        <li>!没有分页数据</li>
    </ul>
</nav>
{% endif %}

<script>
    $(function(){
        $('[name=pageSize]').change(function(){
           var value = $(this).val();
            window.location.href = '/admin/user/list?pageNo={{page.pageNo}}&pageSize='+value;
        });
    });
</script>